<?php
	require '../config/config.php';
	$ConfigSql="select * from config where id='1'";
	$ConfigInfo=mysqli_query($con,$ConfigSql);
	$ConnfigRs=mysqli_fetch_array($ConfigInfo);
	session_start();
	$user=$_GET['user'];
	if(empty($user)){
	    echo "<script>location='../index.php';</script>";
	}
	$sql="select * from member where user='".$user."'";
	$info=mysqli_query($con,$sql);
	$rs=mysqli_fetch_array($info);
	if($rs['user']==""){
	    echo "<script>location='./index.php';</script>";
	}
	$sql="select * from loginlog where user='".$user."' order by id desc";//asc desc
	$result=mysqli_query($con,$sql);
	$result=mysqli_fetch_array($result)
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo $ConnfigRs['name'];?>-个人中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../css/head.css"/>
  <link rel="stylesheet" href="../layui/css/layui.css">

<link rel="stylesheet" href="../css/global.css">

<script src="../layui/layui.js"></script>
</head>
<body >

<div class="dvhead">
	<div class="dvlogo"><a href="../../../index.php">校园服务反馈系统</a></div>
	<div class="dvreg">
		<?php
		    if(empty($_SESSION['member'])){
                echo "已有账号，立即&nbsp;<a href='login.php'>登录</a>";
            }else{
                echo "欢迎您，".$_SESSION['member']." &nbsp;&nbsp;<a href='?ops=logout'> 退出</a>";
            }
		?>
	</div>
</div>

<div class="main layui-clear">
  <div class="fly-panel" pad20>
    <div class="layui-form layui-form-pane">
		<form method="post">
			<table class="news-edit">
				<tr>
					<th>账&nbsp;&nbsp;&nbsp;号：</th>
					<td><?php echo $rs['user'];?></td>
				</tr>
				<tr>
					<th>状&nbsp;&nbsp;&nbsp;态：</th>
					<td>
					    <?php 
					        if($rs['password']==""){
					            echo "已经注销";
					        }else{
					            echo "状态正常";
					        }
					    ?>
					</td>
				</tr>
				<tr>
					<th>更&nbsp;&nbsp;&nbsp;多：</th>
					<td>最后登录时间 >> <font color="red"><?php echo $result['time'];?></font> &nbsp; &nbsp; IP >> <font color="red"><?php echo $result['ip'];?></font></td>
				</tr>
				<tr>
					<th>操&nbsp;&nbsp;&nbsp;作：</th>
					<td>添加好友（功能未开放）</td>
				</tr>
			</table>
		</form>
    </div>
  </div>
</div>

 <script type="text/javascript" charset="utf-8" src="js/kindeditor.js"></script>
  <script type="text/javascript">
    KE.show({
        id : 'content',
		resizeMode : 1,
        cssPath : './index.css',
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>
<script>

layui.cache.page = '';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "2.0.0"
  ,base: '../res/mods/'
}).extend({
  fly: 'index'
}).use('fly');
</script>
</body>
</html>